﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace TestFrame
{
    class MyToken
    {
        public SocketAsyncEventArgs read_arg, write_arg;

        public Socket socket;
        List<byte> cache = new List<byte>();

        bool isRead = false;

        public MyToken() {
            read_arg.UserToken = this;
            write_arg.UserToken = this;
        }
        public void Close() {
            try {
                socket.Shutdown(SocketShutdown.Both);
                socket.Close();
                socket = null;
            }
            catch(Exception ex) {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}
